package io.github.xbeeant.eoffice.service.impl;

import io.github.xbeeant.core.IdWorker;
import io.github.xbeeant.eoffice.config.AbstractSecurityMybatisPageHelperServiceImpl;
import io.github.xbeeant.eoffice.mapper.ResourcesAttrMapper;
import io.github.xbeeant.eoffice.model.ResourcesAttr;
import io.github.xbeeant.eoffice.service.IResourcesAttrService;
import io.github.xbeeant.spring.mybatis.pagehelper.IMybatisPageHelperDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * eoffice_resources_attr
 */
@Service
public class ResourcesAttrServiceImpl extends AbstractSecurityMybatisPageHelperServiceImpl<ResourcesAttr, Long> implements IResourcesAttrService {

    @Autowired
    private ResourcesAttrMapper resourcesAttrMapper;

    @Override
    public boolean isWithBlobs() {
        return true;
    }

    @Override
    public IMybatisPageHelperDao<ResourcesAttr, Long> getRepositoryDao() {
        return this.resourcesAttrMapper;
    }

    @Override
    public void setDefaults(ResourcesAttr record) {
        if (record.getRaid() == null) {
            record.setRaid(IdWorker.getId());
        }
    }
}
